package com.newx.auth.license.domain;


import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Licence对象
 * {
 *     "licenseId": "LIC123456789",
 *     "hardwareFingerprint": "abcdef1234567890abcdef1234567890",
 *     "validFrom": "1735660800000",
 *     "validTo": "1767196800000",
 *     "signature": "base64EncodedSignature"
 * }
 * @Created by yxl
 * @Date 2025/2/14 16:29
 */
public class License implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 许可证ID：用于唯一标识许可证。
     */
    private String licenseId;
    /**
     * 硬件指纹：用于绑定特定服务器。
     */
    private String hardwareFingerprint;

    /**
     * 签发时间：表示该许可证的签发日期。
     */
    private Timestamp validFrom;
    /**
     * 到期时间：表示该许可证的到期日期。
     */
    private Timestamp validTo;
    /**
     * 签名：用于验证许可证的有效性。
     */
    private String signature;

    public License() {}

    public License(String licenseId, String hardwareFingerprint, Timestamp validFrom, Timestamp validTo) {
        this.licenseId = licenseId;
        this.hardwareFingerprint = hardwareFingerprint;
        this.validFrom = validFrom;
        this.validTo = validTo;
    }

    // Getters and Setters

    public String getLicenseId() {
        return licenseId;
    }

    public void setLicenseId(String licenseId) {
        this.licenseId = licenseId;
    }

    public String getHardwareFingerprint() {
        return hardwareFingerprint;
    }

    public void setHardwareFingerprint(String hardwareFingerprint) {
        this.hardwareFingerprint = hardwareFingerprint;
    }

    public Timestamp getValidFrom() {
        return validFrom;
    }

    public void setValidFrom(Timestamp validFrom) {
        this.validFrom = validFrom;
    }

    public Timestamp getValidTo() {
        return validTo;
    }

    public void setValidTo(Timestamp validTo) {
        this.validTo = validTo;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }
}

